import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** PI 排班计划信息 */
export interface ConfigureComboSchedule {
          id: number; // 主键
          scheduleDate?: string | Dayjs; // 排班日期
          piConfigureComboId?: number; // 排班套餐id
          piShiftId?: number; // 班次
          user?: string; // 人员岗位
          userId?: number; // 用户
  }

// PI 排班计划 API
export const ConfigureComboScheduleApi = {
  // 查询PI 排班计划分页
  getConfigureComboSchedulePage: async (params: any) => {
    return await request.get({ url: `/pi/configure-combo-schedule/page`, params })
  },

  // 查询PI 排班计划详情
  getConfigureComboSchedule: async (id: number) => {
    return await request.get({ url: `/pi/configure-combo-schedule/get?id=` + id })
  },

  // 新增PI 排班计划
  createConfigureComboSchedule: async (data: ConfigureComboSchedule) => {
    return await request.post({ url: `/pi/configure-combo-schedule/create`, data })
  },

  // 修改PI 排班计划
  updateConfigureComboSchedule: async (data: ConfigureComboSchedule) => {
    return await request.put({ url: `/pi/configure-combo-schedule/update`, data })
  },

  // 删除PI 排班计划
  deleteConfigureComboSchedule: async (id: number) => {
    return await request.delete({ url: `/pi/configure-combo-schedule/delete?id=` + id })
  },

  /** 批量删除PI 排班计划 */
  deleteConfigureComboScheduleList: async (ids: number[]) => {
    return await request.delete({ url: `/pi/configure-combo-schedule/delete-list?ids=${ids.join(',')}` })
  },

  // 导出PI 排班计划 Excel
  exportConfigureComboSchedule: async (params) => {
    return await request.download({ url: `/pi/configure-combo-schedule/export-excel`, params })
  },
}